<?php
$studentId = $_GET['student_id'] ?? '';

// 从数据库删除 $classId 的班级
$dsn = "sqlsrv:Server=localhost;Database=Student";
$db = new PDO($dsn, "sa", "123456");

$sql = "delete from Student where StudentId='{$studentId}'";
$result = $db->exec($sql);
if ($result) {
    echo '删除成功，前往<a href="student_list.php">列表页</a>';
} else {
    echo '删除失败';
}
